home *** CD-ROM | disk | FTP | other *** search
- From: tim@franck.Princeton.EDU (Tim Hollebeek)
- Message-ID: <4g5ddd$56t@cnn.Princeton.EDU>
- X-Original-Date: 17 Feb 1996 20:22:05 GMT
- Path: in2.uu.net!bounce-back
- Date: 19 Feb 96 02:23:48 GMT
- Approved: fjh@cs.mu.oz.au
- Newsgroups: comp.std.c++
- Subject: default template args in a typedef
- Organization: Princeton University
- X-Newsreader: TIN [version 1.2 PL2]
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBFAgUBMSffQOEDnX0m9pzZAQHvUQF9E/SV4/M+SZ7MTeCeYaJ7t3i6nTKCdXlD
- 6At3RLfrJGkc7ht7ybJDEKU4gewisi4m
- =tY3B
-
- Is this legal?
-
- -------
- template <class T>
- class X {
- };
-
- template <class T, class U = X<T> >
- class Y {
- };
-
- typedef Y<double, X<double> > Z1;
- typedef Y<double> Z2;
-
- int main() {
- Z1 z1;
- Z2 z2; // <--- here
- }
- -------
-
- g++ 2.7.2 doesn't mind Z1, but gives:
-
- aggregate `Y<...> z2' has incomplete type and cannot be initialized
-
- on the Z2 line.
-
- ---------------------------------------------------------------------------
- Tim Hollebeek | Disclaimer :=> Everything above is a true statement,
- <space for rent> | for sufficiently false values of true.
- Princeton Univ. | email: tim@wfn-shop.princeton.edu
- -------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)
- ---
- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
- Contact address: std-c++-request@ncar.ucar.edu. Moderation policy:
- http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
-